#ifndef LUX_H
#define LUX_H

#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/i2c-dev.h>
#include <linux/i2c.h>
#include <math.h>

#define DEVICE_NAME "/dev/i2c-0"
#define I2C_ADDR  0x4a
#define REG_ADDR  0x00

class lux
{
public:
    lux();
    int transfer(u_int8_t buf[], int size);
    int getExpo();
    int light;
    int expo;

private:
    u_int8_t luxBuff[4];

    int fd = -1;
    struct i2c_rdwr_ioctl_data data;
    unsigned char sendbuf[sizeof(unsigned char) + 1] = {0};
    unsigned char recvbuf[sizeof(unsigned char) + 1] =  {0};
};

#endif // LUX_H
